package com.common.core.utils;


import com.alibaba.fastjson.JSONObject;
import com.google.gson.Gson;

/**
 * json工具类
 */
public class JsonUtil{

  //默认成功
  private boolean flag=true;
  private String msg;
  private JSONObject josnObj;

  private static Gson gson = new Gson();

  public boolean isFlag() {
    return flag;
  }

  public void setFlag(boolean flag) {
    this.flag = flag;
  }

  public String getMsg() {
    return msg;
  }

  public void setMsg(String msg) {
    this.msg = msg;
  }

  public JSONObject getJosnObj() {
    return josnObj;
  }

  public void setJosnObj(JSONObject josnObj) {
    this.josnObj = josnObj;
  }

  public static Gson getGson(){
    return gson;
  }

  public static String toJson(Object o){
    return gson.toJson(o);
  };

}
